FlushVol
FlushVol
Update disk with any unwritten data short vRefNum ; volume reference number FlushVol stores to disk all unwritten data currently in the volume buffer. It should be called periodically (certainly after closing a file) to protect against
power loss or unexpected disk ejection.
volName is the address of a length-prefixed, pascal-style string containing
the name of the volume you wish to flush. If volName is NIL (0), the
vRefNum is the reference number of the volume you wish to flush. This parameter is used only if volName is invalid or NIL.
noErr (0) No error
bdNamErr (-37) Invalid volName
extFSErr (-57) External file system
ioErr (-36) I/O error
nsvErr (-35) No such volume
paramErr (-50) No default volume
Notes: If volName is NIL and vRefNum is 0, the default volume is flushed (see SetVol). If the volume buffer has not changed since the last call to FlushVol is called automatically whenever a disk is ejected (Eject) or The PBFlushFile function can be used to flush the contents of a single file to disk.